<script setup lang="ts">

import {useGrade} from "../hooks/useGrade";
import {onMounted, ref} from 'vue'
import type {TabsPaneContext} from 'element-plus'
import GradeBarView from "./GradeBarView.vue";
import NextGradeView from "./NextGradeView.vue";
import {useUserGradeInfo} from "../hooks/useUserGradeInfo";
import UserAccompView from "./UserAccompView.vue";

const {isLogin} = useGrade()
const {next_data} =useUserGradeInfo()

onMounted(() => {
  isLogin()
})
const activeName = ref('first')

const handleClick = (tab: TabsPaneContext, event: Event) => {
  console.log(tab, event)
}
</script>

<template>
  <div class="grade-box">
    <div class="grade-main-box">
      <el-tabs v-model="activeName" type="border-card" class="demo-tabs" lazy @tab-click="handleClick">
        <el-tab-pane label="作者权益" name="first">
          <div class="grade-sco">
            <grade-bar-view :grade="3"></grade-bar-view>
            <next-grade-view :data="next_data" :grade="3"></next-grade-view>
            <user-accomp-view :grade="3"></user-accomp-view>
          </div>
        </el-tab-pane>
        <el-tab-pane label="成长任务" name="second">Config</el-tab-pane>
        <el-tab-pane label="热点任务" name="third">Role</el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<style scoped lang="scss">
@import "style/Grade";
</style>
